
import http from '@/util/request'
//公用
export default {
  upload: {
    url: `${process.env.VUE_APP_API_URL}/eduWeixin/fileupload`,
    name: "图片上传",
    post: async function (params) {
      const dataObj = await http.post(this.url, params);
      return dataObj
    }
  },
  wxUpload: {
    url: `${process.env.VUE_APP_API_URL}/eduWeixin/uploadResMedias`,
    name: "图片上传--微信上传",
    post: async function (params) {
      const dataObj = await http.post(this.url, params);
      return dataObj
    }
  },
  weixin: {
    url: `${process.env.VUE_APP_API_URL}/shijiwxy/wechat/portal/getWxJsConfig.json`,
    name: "获取微信权限",
    get: async function (params) {
      const dataObj = await http.get(this.url, params);
      return dataObj
    }
  },
  login: {
    url: `${process.env.VUE_APP_API_URL}/esb/api/wxredirect`,
    name: "横版登录",
    post: async function (params) {
      //return await http.post(this.url, params);
      const res = await http.post(this.url, params);
      // //如果是在openid失效的情况下调用了openid登录
      return res
    }
  },
  getTemplate: {
    url: `${process.env.VUE_APP_API_URL}/studentATND/studentLeaveModel/getStudentLeaveModelList.json`,
    name: "获取考勤模板信息",
    get: async function (params) {
      const dataObj = await http.get(this.url, params);
      return dataObj
    }
  },
  recordRead: {
    url: `${process.env.VUE_APP_API_URL}/studentATND/wechat/portal/studentAttendance/leaveRecordsMarkRead.htm`,
    name: "假条设置为已读",
    post: async function (params) {
      const dataObj = await http.post(this.url, params);
      return dataObj
    }
  },
  delRecord: {
    url: `${process.env.VUE_APP_API_URL}/studentATND/wechat/portal/studentAttendance/delLeaveRecord.htm`,
    name: "删除假条",
    post: async function (params) {
      const dataObj = await http.post(this.url, params);
      return dataObj
    }
  },
  detail: {
    url: `${process.env.VUE_APP_API_URL}/studentATND/wechat/portal/leave/getStudentLeaveRecordDeatil.htm`,
    name: "获取考勤模板信息",
    get: async function (params) {
      const dataObj = await http.get(this.url, params);
      return dataObj
    }
  },
  submit: {
    url: `${process.env.VUE_APP_API_URL}/studentATND/wechat/portal/studentAttendance/submitLeaveRecord.htm`,
    name: "提交考勤请假",
    post: async function (params) {
      const dataObj = await http.post(this.url, params);
      return dataObj
    }
  },
  diningData: {
    url: `${process.env.VUE_APP_API_URL}/eduMeal/api/dining/leaveDailyDining`,
    name: "通过请假日期查询用餐数据",
    get: async function (params) {
      const dataObj = await http.get(this.url, params);
      return dataObj
    }
  },
  diningOption: {
    url: `${process.env.VUE_APP_API_URL}/eduMeal/api/report-setting/getByOrgId`,
    name: "查询学校用餐配置",
    get: async function (params) {
      const dataObj = await http.get(this.url, params);
      return dataObj
    }
  },
  stuDiningSet: {
    url: `${process.env.VUE_APP_API_URL}/eduMeal/api/dining/modifyByLeave`,
    name: "保存请假学生请假期间的用餐设置",
    post: async function (params) {
      const dataObj = await http.post(this.url, params);
      return dataObj
    }
  }
}
